//
//  ViewController.swift
//  PickerView
//
//  Created by 李成 on 2023/12/12.
//

import UIKit

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.
        
        let btn = UIButton(frame: CGRect(x: 180, y: 300, width: 100, height: 40))
        btn.backgroundColor = .orange
        btn.addTarget(self, action: #selector(btnTouch), for: .touchUpInside)
        view.addSubview(btn)
        
        
        
    }
    
    
    @objc func btnTouch() {
        
        let alertView = TeilPickerAlertView(frame: view.bounds)
        alertView.delegate = self
        
        alertView.showAlert(view: view)
        
    }
    

}


extension ViewController: TeilPickerAlertViewDelegate {
    
    func selectedItem(text: String, identifier: String) {
        print("选中的文本：\(text)")
    }
    
}

